import Vue from "vue";
import Vuex from 'vuex';

Vue.use(Vuex);

const store=new Vuex.Store({
  state:{//设置值的方法
    HOST:'http://127.0.0.1:8888',
    isPlay:false,
    url:'',
    id:''
  },
  getters:{//取值的方法
    isPlay: state => state.isPlay,
    url:state => state.url,
    id:state => state.id

  },

  mutations:{//设置值的方法

    setIsPlay: (state, isPlay) => {state.isPlay=isPlay},
    setUrl: (state, url) => {state.url=url},
    setId: (state, id) => {state.id=id},

  }




})

export default store
